﻿using System;
using Library.Util;

namespace Cloud.Util
{
    public partial class Captcha : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack || Page.IsCallback) return;
            var guvenlikKodu = IdGenerator.GenerateString(6);
            Session["GuvenlikKodu"] = guvenlikKodu;
            var ci = new CaptchaImage(guvenlikKodu, 200, 50, "Courier");
            Response.Clear();
            Response.ContentType = "image/jpeg";
            ci.Image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
            ci.Dispose();
        }
    }
}